﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace ServiceHost
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IService1
    {
     
        public HotSpot[] GetHotSpots(Coordinate location, string token)
        {
            //TODO: Save device location

            var hotSpots = HotSpotHelper.GetHotSpots(location);

            return hotSpots;
        }

        public Route[] GetSafeRoutes(Coordinate location)
        {
            //Get HotSpots
            var hotSpots = HotSpotHelper.GetHotSpots(location);

            //Get NearBy Towns
            var towns = TownHelper.GetNearByTowns(location);

            //Get Safe Routes
            var routes = RouteHelper.GetSafeRoutes(hotSpots, towns, location);

            //Return HotSpots and Safe Routes
            return routes;
        }

        public void SendAlert()
        {            
            AlertHelper.SendAlert();
        }
    }
}
